Skip to content

feat: CLI prove use bin name for output path #1675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 27, 2025

Conversation

stephenh-axiom-xyz
Copy link
Contributor

@stephenh-axiom-xyz stephenh-axiom-xyz commented May 21, 2025

Resolves INT-4074. Primarily accomplishes the following:

  • cargo openvm prove outputs proofs to ${bin_name}.app.proof instead of app.proof, where bin_name is the file stem of the executable (same for stark and evm)
  • cargo openvm verify by default searches the working directory for files with extension .app.proof

Additionally, the following are also in this PR:

  • cargo openvm init ${dir} creates directory dir if it doesn't already exist
  • Updates to the book to reflect recent CLI changes

The following were merged from #1689:

  • SDK functionality to verify e2e STARK proofs
  • cargo openvm verify stark subcommand

Options `--manifest-path`, `--target-dir` are also available to `verify`. If you omit `--app_vk` and/or `--proof`, the command will search for those files at `${target_dir}/openvm/app.vk` and `./app.proof` respectively.
Options `--manifest-path`, `--target-dir` are also available to `verify`. If you omit `--app_vk` the command will search for the verifying key at `${target_dir}/openvm/app.vk`.

If you omit `--proof`, the command will search the working directory for files with the `.app.proof` extension. Note that for this default case a single proof is expected to be found, and `verify` will fail otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think verify should always pass in --proof to be explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily opposed to this, but our CLI toolchain generally has the semantic where we allow file inputs to be omitted if there's exactly one option. Given that we error out if there isn't exactly one option, I think it might be good to maintain this behavior in verify. Lmk what you think!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when you do prove, because the input (exe) is a generated, and is never really being "used" directly outside of the openvm context, we can use some reasonable default.
But I think the "proof" is a bit different in that it's the final object that when will used elsewhere (onchain?) so would make sense to be explicit. Want to avoid the case that user think a proof is verified, but actually they verify something else (on the default path)

wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From earlier discussions with Jonathan, I think we should assume that all of the generated artifacts (i.e. .pk, .vk, .vmexe, etc.) can and likely will be used somewhere. Default naming is done using the project's structure, which the user should in theory know about and set.

I don't think it's a stretch to assume that users will be able to deduce that a verify call with no --proof specified will look in the working directory, especially since that's the output behavior of prove? In general I feel like if a user does prove --proof file.proof they should know to do verify --proof file.proof.

That being said, regardless of what we choose we should probably output a success message with the proof path. As of now there's no messaging, which does indeed make it difficult to confirm what's going on 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i think printing the proof path is a good idea. ok i think this is probably fine

Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (+15 [+1.3%]) 1,147 334,023 17,675,870 - - -
fibonacci (-3 [-0.1%]) 2,468 1,500,277 50,589,503 - - -
regex (+50 [+0.7%]) 7,427 4,165,226 166,511,152 - - -
ecrecover (-29 [-2.1%]) 1,359 (+20412 [+7.1%]) 309,859 (+672913 [+4.7%]) 15,143,099 - - -
pairing (-91 [-2.0%]) 4,468 (+36796 [+2.0%]) 1,857,232 (+1223114 [+1.3%]) 97,055,521 - - -

Commit: f6a2562

Benchmark Workflow

@stephenh-axiom-xyz stephenh-axiom-xyz merged commit 3b5b91c into release-v1.2.1-rc.0 May 27, 2025
26 checks passed
@stephenh-axiom-xyz stephenh-axiom-xyz deleted the feat/prove-default-name branch May 27, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants